<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
            <span class="sr-only">导航条</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="{:U('/')}" title='<php>echo getSiteOption('siteName');</php>'><php>echo getSiteOption('siteName');</php></a>
    </div>
    <div class="collapse navbar-collapse" id="navbar">
        <ul class="nav navbar-nav">
            <php>
				$nav = S('nav');
                                if(empty($nav)){
                                    $nav = M('links')->where(array('status' => 1 , 'is_where' => 1))->select(); 
                                    S('nav',$nav);
                                    $nav = S('nav');
                                }
	  </php>
            <foreach name='nav' item='nav'>
            <li>
                <a href="{$nav.src}" title='{$nav.title}'><span id="navbarCurrent">{$nav.title}</span></a>
            </li>
            </foreach>
        </ul>
        <form class="navbar-form navbar-left" role="search" method="get"  action="{:U('/home/search')}">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="Search"  name="key" >
                <input  type="hidden"  name="flag"  value='index' />
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>
</nav>
